<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
                'id' => 'brand-details-form',
                'enableAjaxValidation' => false,
            ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php echo $form->errorSummary($model); ?>


    <table>
        <tr>
            <td><?php echo $form->labelEx($model, 'brand_id'); ?></td>
            <td>
                <? echo $model->brand_id; ?>
                <?php echo $form->textField($model, 'brand_id'); ?>
                <?php echo $form->error($model, 'brand_id'); ?>
            </td>
        </tr>
        <tr>
            <td><?php echo $form->labelEx($model, 'brand_details'); ?></td>
            <td>
                <?php echo $form->textArea($model, 'brand_details', array('rows' => 6, 'cols' => 50)); ?>
                <?php echo $form->error($model, 'brand_details'); ?>
            </td>
        </tr>
        <tr>
            <td><?php echo $form->labelEx($model, 'brand_email'); ?></td>
            <td>
                <?php echo $form->textField($model, 'brand_email', array('size' => 60, 'maxlength' => 100)); ?>
                <?php echo $form->error($model, 'brand_email'); ?>
            </td>
        </tr>
        <tr>
            <td><?php echo 'Products Images' ?></td>
            <td>
                <input type="button" value="Upload" onclick="image_upload('button_upload','prebutton_upload');"/> <span style="color: blue;"> Please upload image into directory "/image/product/<?php echo $model->brand_id ?>"</span>
            </td>
        </tr>

    </table>

    <div class="row buttons">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
            </div>

    <?php $this->endWidget(); ?>


            </div><!-- form -->
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/jquery-1.6.1.min.js"></script>
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/ui/jquery-ui-1.8.9.custom.min.js"></script>
            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.9.custom.css" />
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/ui/external/jquery.bgiframe-2.1.2.js"></script>
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/jstree/jquery.tree.min.js"></script>
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/jquery/ajaxupload.js"></script>

            <script type="text/javascript"><!--
                function image_upload(field, preview) {
                    $('#dialog').remove();
                    $('#content').prepend('<div id="dialog" style="padding: 3px 0px 0px 0px;"><iframe src="<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index/field/' + encodeURIComponent(field) + '" style="padding:0; margin: 0; display: block; width: 100%; height: 100%;" frameborder="no" scrolling="auto"></iframe></div>');
                    $('#dialog').dialog({
                        title: 'Image Manager',
                        close: function (event, ui) {
                        },
                        bgiframe: false,
                        width: 800,
                        height: 400,
                        resizable: false,
                        modal: false
                    });
                };
                //--></script>

            <script type="text/javascript">
                var textBox = document.getElementById('BrandDetails_brand_id');
                textBox.hidden = true;
            </script>

            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/ckeditor/ckeditor.js"></script>
            <script type="text/javascript"><!--
                CKEDITOR.replace('BrandDetails_brand_details', {
                    filebrowserBrowseUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                    filebrowserImageBrowseUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                    filebrowserFlashBrowseUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                    filebrowserUploadUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                    filebrowserImageUploadUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                    filebrowserFlashUploadUrl: '<?php echo Yii::app()->request->baseUrl; ?>/index.php/Filemanager/index',
                });
                //--></script>
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/ckeditor/config.js?t=B49E5BQ"></script>
            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/javascript/ckeditor/skins/kama/editor.css?t=B49E5BQ">
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/ckeditor/lang/en.js?t=B49E5BQ"></script>
            <script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/javascript/ckeditor/plugins/styles/styles/default.js?t=B49E5BQ"></script>